package com.cjj.common.entity.po.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 管理员表
 * </p>
 *
 * @author BrownC_
 * @since 2021-11-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="TAdmin对象", description="管理员表")
public class Admin implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "唯一uid")
    @TableId(value = "uid", type = IdType.UUID)
    private String uid;

    @ApiModelProperty(value = "用户名")
    @TableField("user_name")
    private String userName;

    @ApiModelProperty(value = "密码")
    @TableField("pass_word")
    private String passWord;

    @ApiModelProperty(value = "性别(1:男2:女)")
    @TableField("gender")
    private String gender;

    @ApiModelProperty(value = "个人头像")
    @TableField("avatar")
    private String avatar;

    @ApiModelProperty(value = "邮箱")
    @TableField("email")
    private String email;

    @ApiModelProperty(value = "出生年月日")
    @TableField("birthday")
    private Date birthday;

    @ApiModelProperty(value = "手机")
    @TableField("mobile")
    private String mobile;

    @ApiModelProperty(value = "邮箱验证码")
    @TableField("valid_code")
    private String validCode;

    @ApiModelProperty(value = "自我简介最多150字")
    @TableField("summary")
    private String summary;

    @ApiModelProperty(value = "登录次数")
    @TableField("login_count")
    private Integer loginCount;

    @ApiModelProperty(value = "最后登录时间")
    @TableField("last_login_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastLoginTime;

    @ApiModelProperty(value = "最后登录IP")
    @TableField("last_login_ip")
    private String lastLoginIp;

    @ApiModelProperty(value = "状态")
    @TableField("status")
    private int status;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @ApiModelProperty(value = "昵称")
    @TableField("nick_name")
    private String nickName;

    @ApiModelProperty(value = "QQ号")
    @TableField("qq_number")
    private String qqNumber;

    @ApiModelProperty(value = "微信号")
    @TableField("we_chat")
    private String weChat;

    @ApiModelProperty(value = "职业")
    @TableField("occupation")
    private String occupation;

    @ApiModelProperty(value = "github地址")
    @TableField("github")
    private String github;

    @ApiModelProperty(value = "gitee地址")
    @TableField("gitee")
    private String gitee;

    @ApiModelProperty(value = "拥有的角色uid")
    @TableField("role_uid")
    private String roleUid;

    @ApiModelProperty(value = "履历")
    @TableField("person_resume")
    private String personResume;

    // 以下字段不存入数据库

    /**
     * 用户头像
     */
    @TableField(exist = false)
    private List<String> photoList;

    /**
     * 所拥有的角色名
     */
    @TableField(exist = false)
    private List<String> roleNames;

    /**
     * 所拥有的角色名
     */
    @TableField(exist = false)
    private TRole role;

    /**
     * 已用网盘容量
     */
    @TableField(exist = false)
    private Long storageSize;

    /**
     * 最大网盘容量
     */
    @TableField(exist = false)
    private Long maxStorageSize;

    /**
     * 令牌UID【主要用于换取token令牌，防止token直接暴露到在线用户管理中】
     */
    @TableField(exist = false)
    private String tokenUid;

    /**
     * 用户角色对应的权限列表
     */
    @TableField(exist = false)
    private List<TCategoryMenu> categoryMenus;



}
